﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <algorithm>
#include <climits>
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n, k, d;
    cin >> n >> k >> d;
    vector<vector<long long>> dpmax(n, vector<long long>(k + 1, 0));
    vector<vector<long long>> dpmin(n, vector<long long>(k + 1, 0));
    vector<int> arr;
    for (int i = 0; i < n; i++)
    {
        int tmp;
        cin >> tmp;
        arr.push_back(tmp);
    }
    for (int i = 0; i < n; i++)
    {
        dpmax[i][1] = arr[i];
        dpmin[i][1] = arr[i];
        for (int j = 2; j <= k; j++)
        {
            for (int m = 1; m <= d; m++)
            {
                if (i - m >= 0)
                {
                    dpmax[i][j] = max(dpmax[i][j], max(dpmax[i - m][j - 1] * arr[i], dpmin[i - m][j - 1] * arr[i]));
                    dpmin[i][j] = min(dpmin[i][j], min(dpmax[i - m][j - 1] * arr[i], dpmin[i - m][j - 1] * arr[i]));
                }
            }
        }
    }
    long long maxi = dpmax[k - 1][k];
    for (int i = k; i < n; i++) maxi = max(maxi, dpmax[i][k]);
    cout << maxi;
    return 0;
}
//1 1 1
//1 0 0
//1 0 0
//1 0 0